<template>
  <div>
    父组件
  <br>
  <input type="text" v-model="name">
  <br>
  <son-com :data="name" @childValue="value"/>

   <br>
   子组件传给父组件的值 :
   {{msg}}
  </div>
</template>

<script>
import sonCom from './son'
export default {
  name:'father',
  components:{
    sonCom
  },
  data(){
    return{
      name:'',
      msg:''
    }
  },
  methods:{
    value(data){
      this.msg = data
      console.log(data);
    }
  }

}
</script>

<style>

</style>